package com.zw.design.pattern.creational.prototype;

public class Test {

    public static void main(String[] args) throws CloneNotSupportedException {

        Mail mail=new Mail();
        mail.setContent("初始化模板");
        System.out.println("mail = " + mail);
        for (int i = 0; i <=10 ; i++) {
            Mail mail1= (Mail) mail.clone();
            mail1.setName("zw"+i);
            mail1.setEmailAddress("zw"+i+"@itzhouwei.com");
            mail1.setContent("恭喜你 此次获得设计模式书籍一本");
            MailUtil.sendMail(mail1);
            System.out.println("mail克隆后 = " + mail1);
        }
        MailUtil.saveOrigin(mail);
    }
}
